package sedh.project

import grails.test.*

class UserIntTestTests extends GroovyTestCase {
    protected void setUp() {
		super.setUp()
    }

    protected void tearDown() {
        super.tearDown()
    }

    void testSalvaUsuario() {
		def user1 = new User(
			username: "usuario1",
			password: "usuario1",
			enabled: true,
			nome: "Usuario1",
			municipio: "Joao Pessoa",
			papel: sedhproject.Papel.USUARIO,
			telefone: "88888888",
			email: "usuario@mail.org",
			rg: "88888888" )
		
		def user2 = new User(
				username: "usuario2",
				password: "usuario2",
				enabled: true,
				nome: "Usuario2",
				municipio: "Campina Grande",
				papel: sedhproject.Papel.TECNICO,
				telefone: "88009388",
				email: "usuario@mail.org",
				rg: "92992345" )
		
		assertNotNull user1.save()
		assertNotNull user2.save()
				
		// 4 pois tem mais 2 adicionados no bootstrap
		assertEquals 4, User.count()
		
    }
}
